home *** CD-ROM | disk | FTP | other *** search
/ Comix Games / Comix Games.iso / jetsons / jetsons.exe / jetsons.dxr / 00008.ls < prev    next >
Encoding:
Text File  |  1996-11-19  |  2.1 KB  |  44 lines

  1. on MoveBackground
  2.   global theFirstBackgroundFrame, theLastBackgroundFrame, theBackgroundVelocity, theInitialBackgroundLocs
  3.   repeat with h = theFirstBackgroundFrame to theLastBackgroundFrame
  4.     set the locH of sprite h to the locH of sprite h + theBackgroundVelocity
  5.   end repeat
  6.   set tempValue to the stageRight
  7.   set leftValue to the stageLeft
  8.   if theBackgroundVelocity < 0 then
  9.     if the right of sprite theFirstBackgroundFrame <= 0 then
  10.       set x1 to the right of sprite theLastBackgroundFrame
  11.       set x2 to x1 + the width of sprite theFirstBackgroundFrame
  12.       set y1 to the top of sprite theFirstBackgroundFrame
  13.       set y2 to the bottom of sprite theFirstBackgroundFrame
  14.       spriteBox(theFirstBackgroundFrame, x1, y1, x2, y2)
  15.     else
  16.       if the right of sprite theLastBackgroundFrame <= 0 then
  17.         set x1 to the right of sprite theFirstBackgroundFrame
  18.         set x2 to x1 + the width of sprite theLastBackgroundFrame
  19.         set y1 to the top of sprite theLastBackgroundFrame
  20.         set y2 to the bottom of sprite theLastBackgroundFrame
  21.         spriteBox(theLastBackgroundFrame, x1, y1, x2, y2)
  22.       end if
  23.     end if
  24.   else
  25.     if theBackgroundVelocity > 0 then
  26.       if the left of sprite theFirstBackgroundFrame >= (the stageRight - the stageLeft) then
  27.         set x1 to the left of sprite theLastBackgroundFrame - the width of sprite theFirstBackgroundFrame
  28.         set x2 to x1 + the width of sprite theFirstBackgroundFrame
  29.         set y1 to the top of sprite theFirstBackgroundFrame
  30.         set y2 to the bottom of sprite theFirstBackgroundFrame
  31.         spriteBox(theFirstBackgroundFrame, x1, y1, x2, y2)
  32.       else
  33.         if the left of sprite theLastBackgroundFrame >= (the stageRight - the stageLeft) then
  34.           set x1 to the left of sprite theFirstBackgroundFrame - the width of sprite theLastBackgroundFrame
  35.           set x2 to x1 + the width of sprite theLastBackgroundFrame
  36.           set y1 to the top of sprite theLastBackgroundFrame
  37.           set y2 to the bottom of sprite theLastBackgroundFrame
  38.           spriteBox(theLastBackgroundFrame, x1, y1, x2, y2)
  39.         end if
  40.       end if
  41.     end if
  42.   end if
  43. end
  44.